Skip to content

Fix entrypoint.sh creating one folder named {plugins,embedded-db}#1

Merged
dereckson merged 1 commit into
nasqueron:mainfrom
bdelcamp:main
Oct 14, 2020
Merged

Fix entrypoint.sh creating one folder named {plugins,embedded-db}#1
dereckson merged 1 commit into
nasqueron:mainfrom
bdelcamp:main

Conversation

@bdelcamp

Copy link
Copy Markdown

New install fails to start because required directories are not being created.

@dereckson

dereckson commented Oct 13, 2020

Copy link
Copy Markdown
Member

Thanks for the fix.

Indeed, both the test and prod scripts test the images with a workflow creating first the directory. So that was under the radar.

@dereckson dereckson closed this Oct 13, 2020
@dereckson dereckson reopened this Oct 13, 2020

@dereckson dereckson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Comment thread entrypoint.sh
sudo -HEu "${OPENFIRE_USER}" cp -a /etc/openfire "${OPENFIRE_DATA_DIR}/conf"
fi
sudo -HEu "${OPENFIRE_USER}" mkdir -p "${OPENFIRE_DATA_DIR}/{plugins,embedded-db}"
sudo -HEu "${OPENFIRE_USER}" mkdir -p "${OPENFIRE_DATA_DIR}"/{plugins,embedded-db}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice catch.

Summary:
To allow spaces in variables like OPENFIRE_DATA_DIR, they have been enclosed
in quotes.

As the expression uses GNU coreutils mkdir {} syntax, put the {} in quotes
has broken the directory creation: instead to create /path/to/openfire/plugins
and /path/to/openfire/embedded-db, it created the exact quoted content.

That breaks new installations when directories don't exist.

This change fixes that regression. This is a follow-up for e76b3cf.

Test Plan:
```
$ export OPENFIRE_DATA_DIR=/tmp/openfire
$ mkdir -p "${OPENFIRE_DATA_DIR}"/{plugins,embedded-db}
$ ls $OPENFIRE_DATA_DIR
embedded-db  plugins
```

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D2372
@dereckson

dereckson commented Oct 14, 2020

Copy link
Copy Markdown
Member

Thanks for this correction, that indeed broke the image when not an update.

In October, there is the hacktoberfest with the challenge to submit 4 pull requests to various GitHub repositories.

If you want to participate and get a t-shirt or plant a tree, make 3 more contributions to any project :) More information at
https://hacktoberfest.digitalocean.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants